Recent advances in microprocessor design and component integration have enabled a wide range of devices to offer increasingly complex functionality and “soft” features. Soft features include software applications that enhance and customize the operation of a device. These devices include standard computing devices, such as desktop and laptop computers, portable computing devices, such as personal data assistants, and consumer devices, such as cellular telephones, messaging pagers, gaming consoles, and set top boxes. Most devices now include an operating system to support the soft features and other extensions.
The increased capabilities offered by these software-upgradeable devices have also created certain user expectations. Often, users are not technically savvy and are intolerant of performance compromises occasioned by architectural challenges, such as slow or inconsistent application performance. Similarly, users generally expect to be able to access a host of separate applications, which are implemented at the system level through multitasking. For users, widely available software applications assure a positive experience through consistency and increased exposure across multiple platforms. However, for software developers, engineering software applications for disparate computing platforms entails increased development costs and on-going support and upgrade commitments for each supported architecture.
Managed code platforms provide one solution to software developers seeking to support multiple platforms by presenting a machine-independent and architecture-neutral operating environment. Managed code platforms include programming language compilers and interpreters executed by an operating system as user applications, but which provide virtual runtime environments within which compatible applications can operate. For instance, applications written in the Java programming language, when combined with a Java virtual machine (JVM) runtime environment, can operate on heterogeneous computer systems independent of machine-specific environment and configuration settings. An overview of the Java programming language is described in P. van der Linden, “Just Java,” Ch. 1, Sun Microsystems, Inc. (2d ed. 1997), the disclosure of which is incorporated by reference. JVMs are a critical component to the overall Java operating environment, which can be ported to the full range of computational devices, including memory-constrained consumer devices.
Managed code platforms are generally designed for the monotonic execution of a single application instance. Multiple instances of a managed code platform are executed to simulate multitasking behavior. Such forced concurrency, however, creates several performance problems. First, each instance incurs a startup transient. Executable and startup data must be read from slow persistent storage, which results in slow initial application performance. Similarly, memory is not shared between instances and each additional instance increases the overall memory footprint of the platform by separately loading and instantiating classes, generally problematic in memory-constrained systems. Moreover, data dependencies and deferred initialization of system state can result in non-deterministic execution patterns. Finally, each instance independently determines the relative importance of executing methods and compiles machine code on an ad hoc basis, often causing inconsistent application performance.
One solution to providing concurrently executable managed code platforms involves designating a managed code platform that executes as a master process. Individual child managed code platform processes are spawned from the master process using process cloning and inherit runtime state from the master managed code platform. As a result, each child process benefits from the initialization actions completed by the master process. However, at runtime, static initialization methods can still degrade individual child process performance. Static initialization methods are executed when a class is first used by a running program through, for instance, a static method call, static field access, or instantiation of an instance of the class. As a result, static initialization methods can cause non-deterministic execution and impact child process startup times. In addition, although each static initialization method is only executed once, the code often remains in memory and can increase the memory footprint.
Therefore, there is a need for an approach to performing static initialization methods in a master runtime system process executing in a concurrent managed code platform, such as the Java operating environment. Preferably, such an approach would execute the static initialization methods at boot time and eliminate unnecessary overhead by freeing storage used by the completed static initialization methods. Subsequent cloned child processes would inherit the memory state of the master runtime system process reflecting the effects of the pre-executed static initializers.